package com.econ.powercloud.ems.service.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.econ.powercloud.ems.dal.entity.IotProductEventScript;
import com.econ.powercloud.ems.dal.mapper.IotProductEventScriptMapper;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @ Description:
 * @ Author：hgp
 * @ Create:2023-03-14-13:58
 */
@Repository
public class IotProductEventScriptDAO extends ServiceImpl<IotProductEventScriptMapper, IotProductEventScript> {

    public List<IotProductEventScript> selectListByProductKeyList(List<String> productKeyList) {
        LambdaQueryWrapper<IotProductEventScript> wrapper = Wrappers.lambdaQuery();
        wrapper.in(CollectionUtils.isNotEmpty(productKeyList),IotProductEventScript::getProductKey,productKeyList);
        return this.baseMapper.selectList(wrapper);
    }

}
